Skip to content

ci/ai: make git checkout work in the /investigate workflow#172001

Merged
rickystewart merged 1 commit into
cockroachdb:masterfrom
rickystewart:ricky/kprnwwwlopox
Jun 25, 2026
Merged

ci/ai: make git checkout work in the /investigate workflow#172001
rickystewart merged 1 commit into
cockroachdb:masterfrom
rickystewart:ricky/kprnwwwlopox

Conversation

@rickystewart

Copy link
Copy Markdown
Contributor

The /investigate agent reliably runs git checkout <sha> to inspect the failure commit rather than the checkout-sha helper, despite the prompt telling it not to. In the blobless clone that triggers a lazy blob fetch which GitHub's promisor remote rejects ("not our ref") for any commit not reachable from the default branch -- i.e. essentially every failure SHA. The agent then gives up and analyzes master tip, which is the persistent failure reported for the workflow.

Rather than depend on the agent obeying the instruction (it doesn't), make the reflex command work. Install a git wrapper on PATH that execs the real binary for everything and, for checkout/switch only, retries after importing the target commit's snapshot when the lazy fetch fails. The snapshot import is factored out of checkout-sha into a shared snapshot-fetch helper. The prompt is updated to match: a plain git checkout <sha> now works.

The /investigate agent reliably runs `git checkout <sha>` to inspect
the failure commit rather than the `checkout-sha` helper, despite the
prompt telling it not to. In the blobless clone that triggers a lazy
blob fetch which GitHub's promisor remote rejects ("not our ref") for
any commit not reachable from the default branch -- i.e. essentially
every failure SHA. The agent then gives up and analyzes master tip,
which is the persistent failure reported for the workflow.

Rather than depend on the agent obeying the instruction (it doesn't),
make the reflex command work. Install a `git` wrapper on PATH that
execs the real binary for everything and, for checkout/switch only,
retries after importing the target commit's snapshot when the lazy
fetch fails. The snapshot import is factored out of checkout-sha into
a shared snapshot-fetch helper. The prompt is updated to match: a
plain `git checkout <sha>` now works.
@rickystewart rickystewart requested a review from a team as a code owner June 25, 2026 15:16
@rickystewart rickystewart merged commit 8ee72ef into cockroachdb:master Jun 25, 2026
20 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants